{% from '_helpers.html' import external_bugs %}
{%- for problem in problems %}
  <tr>
    <td>
      <a href="{{ url_for('problems.item', problem_id=problem.id) }}">
        {{ problem.id }}
      </a>
    </td>
    <td>
      {%- for name in problem.unique_component_names %}
        {{ name }}{% if not loop.last %}, {% endif %}
      {%- endfor %}
      {%- if problem.tainted %}
        <span class="label label-warning">Tainted</span>
      {%- endif %}
    </td>
    <td>
{% if problem.crash_function %}
      <div class="crash-fn-container">
        <div class="crash-fn">{{ problem.crash_function }}</div>
        <a class="expander" hidden href="#"></a>
      </div>
{% endif %}
    </td>
    <td>
      <span class="label label-{{ problem.status|problem_label }}">
        {{ problem.status }}
      </span>
    </td>
    <td>
      {{ external_bugs(problem.id, problem.bugs, false) }}
    </td>
    <td>
      {%- if problem.probable_fixes %}
        {{ problem.probable_fixes|join(", ") }}
      {%- endif %}
    </td>
    <td class="cell-count">{{ problem.count|readable_int }}</td>
  </tr>
{%- endfor %}
